#ifndef ZIGBEESERIALPORTCONTROLSIMULATOR_H
#define ZIGBEESERIALPORTCONTROLSIMULATOR_H

#include <QObject>
////
/// \brief The ZigBeeSerialPortControlSimulator class 模拟zigbee串口
///
class ZigBeeSerialPortControlSimulator : public QObject
{
    Q_OBJECT
public:

    typedef enum {ZIGBEE, GSM} WORKMODE;
    explicit ZigBeeSerialPortControlSimulator(QObject *parent = 0);

    ///
    /// \brief setWorkMode 没什么作用，呵呵
    /// \param mode_
    ///
    void setWorkMode(WORKMODE mode_)
    {
        m_currentWorkMode = mode_;
    }

signals:
    /**
     * @brief sig_realTimeInfo 上报实时的信息
     * @param info
     */
    void sig_realTimeInfo(const QString &info);

    /**
     * @brief sig_SerialPortInfo 报告设备名和设备状态
     * @param fileName
     * @param onOff
     */
    void sig_SerialPortInfo(const QString &fileName,bool onOff);


    void sig_open();
    void sig_close();

public slots:
    ///
    /// \brief slt_setDevOnOrOff 设置操作
    /// \param fileName　文件名
    /// \param onOff　打开还是关闭
    ///
    void slt_setDevOnOrOff(const QString& fileName,bool onOff);


    /**
     * @brief slt_SerialPortInfo
     * @param fileName
     */
    void slt_SerialPortInfo(const QString &fileName);//查看串口设备

private:
    QString m_qstrFileName;
    bool m_bOpen;
    WORKMODE m_currentWorkMode;

};

#endif // ZIGBEESERIALPORTCONTROLSIMULATOR_H
